/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package almacen.view;

import javax.swing.JOptionPane;

/**
 *
 * @author Antonio
 */
public class Principal extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    public Principal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem5 = new javax.swing.JMenuItem();
        jPanel1 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        bt_cliente = new javax.swing.JButton();
        bt_producto = new javax.swing.JButton();
        bt_proveedor = new javax.swing.JButton();
        bt_sector = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        bt_salir = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        menu_registro = new javax.swing.JMenu();
        menuItem_cliente = new javax.swing.JMenuItem();
        menuItem_producto = new javax.swing.JMenuItem();
        menuItem_proveedor = new javax.swing.JMenuItem();
        menuItem_sector = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        menuItem_ciudad = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        menuItem_salir = new javax.swing.JMenuItem();
        menuItem_clientes = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        menu_movimiento = new javax.swing.JMenu();

        jMenuItem5.setText("jMenuItem5");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema Comercial");
        setBackground(new java.awt.Color(51, 204, 255));

        jPanel1.setForeground(new java.awt.Color(51, 204, 255));

        jToolBar1.setBackground(new java.awt.Color(0, 204, 255));
        jToolBar1.setRollover(true);

        bt_cliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/community_obj.gif"))); // NOI18N
        bt_cliente.setToolTipText("Clientes");
        bt_cliente.setFocusable(false);
        bt_cliente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_cliente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_clienteActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_cliente);

        bt_producto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/javadev_obj.gif"))); // NOI18N
        bt_producto.setToolTipText("Productos");
        bt_producto.setFocusable(false);
        bt_producto.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_producto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_producto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_productoActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_producto);

        bt_proveedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/migrate_obj.gif"))); // NOI18N
        bt_proveedor.setToolTipText("Proveedores");
        bt_proveedor.setFocusable(false);
        bt_proveedor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_proveedor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_proveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_proveedorActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_proveedor);

        bt_sector.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/rcpapp_obj.gif"))); // NOI18N
        bt_sector.setToolTipText("Sectores");
        bt_sector.setFocusable(false);
        bt_sector.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_sector.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_sector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_sectorActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_sector);
        jToolBar1.add(jSeparator2);

        bt_salir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/close.gif"))); // NOI18N
        bt_salir.setToolTipText("Salir");
        bt_salir.setFocusable(false);
        bt_salir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_salir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_salirActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_salir);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 799, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        menu_registro.setText("Registro");
        menu_registro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_registroActionPerformed(evt);
            }
        });

        menuItem_cliente.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        menuItem_cliente.setMnemonic('C');
        menuItem_cliente.setText("Clientes");
        menuItem_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_clienteActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_cliente);

        menuItem_producto.setText("Producto");
        menuItem_producto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_productoActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_producto);

        menuItem_proveedor.setText("Proveedor");
        menuItem_proveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_proveedorActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_proveedor);

        menuItem_sector.setText("Sector");
        menuItem_sector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_sectorActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_sector);

        jMenuItem1.setText("Tipo Producto");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        menu_registro.add(jMenuItem1);

        menuItem_ciudad.setText("Ciudad ");
        menuItem_ciudad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_ciudadActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_ciudad);
        menu_registro.add(jSeparator1);

        menuItem_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        menuItem_salir.setMnemonic('S');
        menuItem_salir.setText("Salir");
        menuItem_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_salirActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_salir);

        menuItem_clientes.setText("Clientes con Direccion");
        menuItem_clientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItem_clientesActionPerformed(evt);
            }
        });
        menu_registro.add(menuItem_clientes);

        jMenuItem2.setText("Productos t2ti");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        menu_registro.add(jMenuItem2);

        jMenuItem3.setText("Unidad");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        menu_registro.add(jMenuItem3);

        jMenuItem4.setText("Proveedor");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        menu_registro.add(jMenuItem4);

        jMenuBar1.add(menu_registro);

        menu_movimiento.setText("Movimiento");
        jMenuBar1.add(menu_movimiento);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 1, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 497, Short.MAX_VALUE))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-816)/2, (screenSize.height-638)/2, 816, 638);
    }// </editor-fold>//GEN-END:initComponents

    private void menuItem_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_salirActionPerformed
        String salir = "Esta seguro que desea salir ?";
        int opcion_marcada = JOptionPane.showConfirmDialog(null,salir, "Salir",JOptionPane.YES_NO_CANCEL_OPTION);
        if (opcion_marcada == JOptionPane.YES_OPTION){
            System.exit(0);
        }
    }//GEN-LAST:event_menuItem_salirActionPerformed

    private void menuItem_productoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_productoActionPerformed
        new formProducto().show();
    }//GEN-LAST:event_menuItem_productoActionPerformed

    private void menuItem_sectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_sectorActionPerformed
        new formSector().show();
    }//GEN-LAST:event_menuItem_sectorActionPerformed

    private void bt_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_salirActionPerformed
        String salir = "Esta seguro que desea salir ?";
        int opcion_marcada = JOptionPane.showConfirmDialog(null,salir, "Salir",JOptionPane.YES_NO_CANCEL_OPTION);
        if (opcion_marcada == JOptionPane.YES_OPTION){
            System.exit(0);
        }
        
    }//GEN-LAST:event_bt_salirActionPerformed

    private void bt_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_clienteActionPerformed
        new formCliente().show();
    }//GEN-LAST:event_bt_clienteActionPerformed

    private void bt_productoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_productoActionPerformed
        new formProducto().show();
    }//GEN-LAST:event_bt_productoActionPerformed

    private void bt_proveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_proveedorActionPerformed
        new formProveedor().show();
    }//GEN-LAST:event_bt_proveedorActionPerformed

    private void bt_sectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_sectorActionPerformed
        new formSector().show();
    }//GEN-LAST:event_bt_sectorActionPerformed

    private void menuItem_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_clienteActionPerformed
        new formCliente().show();
    }//GEN-LAST:event_menuItem_clienteActionPerformed

    private void menuItem_proveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_proveedorActionPerformed
        new formProveedor().show();
    }//GEN-LAST:event_menuItem_proveedorActionPerformed

    private void menu_registroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_registroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_menu_registroActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        String args[] = new String[1];
        args[0] = "Registro de Tipos de Producto";
        formProductoTipo.main(args);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void menuItem_ciudadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_ciudadActionPerformed
        String  args[] = new String[1];
        args[0] = "Registro de Ciudades";
        CiudadView.main(args);
    }//GEN-LAST:event_menuItem_ciudadActionPerformed

    private void menuItem_clientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItem_clientesActionPerformed
        String args[] = new String[1];
        args[0] = "Registro de Clientes con Direccion";
        ClienteView.main(args);
    }//GEN-LAST:event_menuItem_clientesActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        String args[] = new String[1];
        args[0] = "Registro de Productos";
        ProductoView.main(args);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        String args[] = new String[1];
        args[0] = "Registro de Unidades";
        UnidadView.main(args);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        String args[] = new String[1];
        args[0] = "Registro de Proveedores";
        ProveedorView.main(args);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_cliente;
    private javax.swing.JButton bt_producto;
    private javax.swing.JButton bt_proveedor;
    private javax.swing.JButton bt_salir;
    private javax.swing.JButton bt_sector;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JMenuItem menuItem_ciudad;
    private javax.swing.JMenuItem menuItem_cliente;
    private javax.swing.JMenuItem menuItem_clientes;
    private javax.swing.JMenuItem menuItem_producto;
    private javax.swing.JMenuItem menuItem_proveedor;
    private javax.swing.JMenuItem menuItem_salir;
    private javax.swing.JMenuItem menuItem_sector;
    private javax.swing.JMenu menu_movimiento;
    private javax.swing.JMenu menu_registro;
    // End of variables declaration//GEN-END:variables
}
